package com.coffee.order.api.inquire.service;

import com.coffee.core.entity.Page;
import com.coffee.core.entity.PagerInfo;
import com.coffee.core.exception.BusinessException;
import com.coffee.order.api.inquire.query.InquireOrderQuery;
import com.coffee.order.api.inquire.req.*;
import com.coffee.order.api.inquire.result.*;
import com.coffee.order.api.sku.result.OrderResult;
import com.coffee.order.api.sku.result.SkuOrderDeliveryDemandResult;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;


public interface InquireOrderService {

    Page<InquireOrderResult> getPager(InquireOrderQuery param, PagerInfo pr);

    Integer count(InquireOrderQuery param);

    InquireOrderResult getDetail(Integer id);

    List<InquireOrderResult> getList(InquireOrderQuery param, PagerInfo pr);

    List<InquireOrderResult> getList(InquireOrderQuery param);

    List<InquireOrderResult> getList();

    void delete(Integer id);

    void addOrUpdate(InquireOrderResult result) throws BusinessException;

    Map<Integer, InquireOrderResult> getItemMap(Set<Integer> idSet);

    Map<Integer, InquireOrderResult> getItemMap();

    //期货商品下单
    void add(AddInquireOrderReq req) throws BusinessException;

    //添加意向报价或者明确报价
    WeiXinPushResult addQuotationScheme(SectionProgrammeReq req) throws BusinessException;

    //确认明确报价
    void buyerConfirm(BuyerConfirmReq req) throws BusinessException;

    //选择意向报价
    void buyerIntentionConfirm(BuyerIntentionConfirmReq req) throws BusinessException;

    //卖方确认
    WeiXinPushResult sellerConfirm(SellerConfirmReq req) throws BusinessException;

    //支付
    WeiXinPushResult pay(SellerConfirmReq req) throws BusinessException;

    //上传签约凭证
    void contract(SellerConfirmReq req) throws BusinessException;

    //设置运费
    WeiXinPushResult setFreight(InquireOrderDeliveryDemandReq req) throws BusinessException;

    //物流付费
    OrderResult logisticsPayByInquire(Integer merchantId, Integer inquireOrderDeliveryDemandId) throws BusinessException;

    //上传物流单号
    WeiXinPushResult setDeliveryDemand(InquireOrderDeliveryDemandReq inquireOrderDeliveryDemandReq) throws BusinessException;

    //创建样品订单
    void sampleOrder(SampleOrderReq req) throws BusinessException;

    //创建样品订单
    void sampleOrderByBuyer(SampleOrderReq req) throws BusinessException;

    //获取期货订单列表
    Page<OrderListResult> getPage(Integer merchantId, String status, PagerInfo pagerInfo);

    //获取订单详情
    InquireOrderResult getInquireOrderResult(Integer inquireOrderResultId) throws BusinessException;

    //异步回调
    public Void notifyRecharge(Integer id, String billNo, Date payTime, Map<String, String> map) throws BusinessException;

    void payContinueByBalance(OrderResult orderResult) throws BusinessException;
    //后台获取订单列表
    Page<SupplierSubOrderListResult> pageSupplierSubOrderListResult(SupplierOrderListReq req, PagerInfo pagerInfo);

    //后台获取订单详情
    SupplierOrderResult getSupplierOrderResult(Integer inquireOrderId, Integer supplier, String roleType) throws BusinessException;

    //取消订单
    void cancelOrder(Integer inquireOrderId, Integer supplierId, String userType, String cancelReason) throws BusinessException;

    void confirmOrder(Integer inquireOrderId, Integer userId, String userType) throws BusinessException;

    void invoicingOrder(Integer inquireOrderId, Integer merchantId, Integer merchantInvoiceId) throws BusinessException;

    void invoicingOrderByInvoicingOrderReq(InvoicingOrderReq req) throws BusinessException;

    //取消等待订单
    void cancelWaitingOrder();

    //取消买方确认订单
    void cancelBuyerConfirmOrder();

    //取消等待付款订单
    void cancelSellerConfirmOrder();

    //交易成功
    void transactionFinash();

    //取消样品等待付款订单
    void cancelSampleSellerConfirmOrder();

    //样品订单交易成功
    void sampleTransactionFinash();

    //取消等待付款的检测订单
    void cancelTestingOrder();


}